import {createRouter, createWebHashHistory} from 'vue-router'
import {Pages} from "@/router/pages";

const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            name: Pages.home,
            component: () => import('@/views/Root.vue'),
            redirect: {name: Pages.discover},
            children: [
                {
                    path: 'discover',
                    name: 'discover',
                    component: () => import("@/views/discover/index.vue"),
                    meta: {
                        menu: 'discover',
                        keepAlive: true,
                    }
                },
                {
                    path: 'list',
                    name: 'list',
                    component: () => import("@/views/list/index.vue"),
                    meta: {
                        menu: 'list',
                        keepAlive: true,
                    },
                },
                {
                    path: 'playlist',
                    name: 'playlist',
                    component: () => import('@/components/common/playlist/PlayList.vue'),
                },
                {
                    path: 'search',
                    name: 'search',
                    component: () => import('@/views/search/index.vue'),
                    meta: {
                        menu: 'search',
                        keepAlive: true,
                    },
                },
                {
                    path: 'singer',
                    name: 'singer',
                    component: () => import("@/views/singer/index.vue"),
                    meta: {
                        menu: 'singer',
                    }
                },
                {
                    path: 'categorizedplaylist',
                    name: 'categorizedplaylist',
                    component: () => import("@/views/categorizedplaylist/index.vue"),
                    meta: {
                        menu: 'categorizedplaylist',
                    }
                },
                {
                    path: 'artistDetail',
                    name: 'artistDetail',
                    component: () => import("@/views/singer/ArtistDetail.vue"),
                    meta: {
                        menu: 'artistDetail',
                    }
                },
                {
                    path: 'mylike',
                    name: 'mylike',
                    component: () => import("@/views/discover/index.vue"),
                    meta: {
                        menu: 'mylike',
                    }
                },
                {
                    path: 'local',
                    name: 'local',
                    component: () => import("@/views/discover/index.vue"),
                    meta: {
                        menu: 'local',
                    }
                },
                {
                    path: 'recently',
                    name: 'recently',
                    component: () => import("@/views/discover/index.vue"),
                    meta: {
                        menu: 'recently',
                    }
                }
            ],
        },
    ]
})
export default router;
